package com.love.cloud.admin.notify.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.love.cloud.admin.notify.dto.NotifyArticleInfoDto;
import com.love.cloud.admin.notify.entity.NotifyArticle;
import com.love.cloud.common.mybatis.mapper.MyBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author hongdongqu
 */
@Mapper
public interface NotifyArticleMapper extends MyBaseMapper<NotifyArticle> {

    /**
     * 获取到文章列表分页
     * @param article
     * @return
     */
    IPage<NotifyArticle> articlePage(Page page, @Param("article") NotifyArticle article);
    /**
     * 获取到文章列表
     * @param article
     * @return
     */
    List<NotifyArticle> getArticleList(@Param("article") NotifyArticle article);

    /**
     * 更新评论数量
     * @param articleId
     * @return
     */
    int updateCommentNum(Long articleId);

    /**
     * 获取到文章详情通过用户id
     * @param userId
     * @return
     */
    NotifyArticleInfoDto getArticleInfoByUserId(Integer userId);
}
